<?php
namespace WinZ\DataMiner\Tests\Entity;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class SessionRepositoryFunctionalTest extends WebTestCase
{
    /**
     * @var \Doctrine\ORM\EntityManager
     */
    private $em;

    /**
     * {@inheritDoc}
     */
    public function setUp()
    {
        static::$kernel = static::createKernel();
        static::$kernel->boot();
        $this->em = static::$kernel->getContainer()
            ->get('doctrine')
            ->getManager()
        ;
    }

    /**
     * @covers WinZ\DataMinerBundle\Entity\Server::getId
     */
    public function testSearchByCategoryName()
    {
        $session = $this->em
            ->getRepository('DataMinerBundle:Session')
            ->find(40);

        $this->assertTrue($session, "Test Session on DB");
        
/*            
        $this->assertTrue($session->getCharacter());
        $this->assertEquals("twolay",$session->getCharacter()->getName() ,"session.character.name <> 'twolay'");
        
        $sessions = $this->em
            ->getRepository('DataMinerBundle:Session')
            ->getByCharacterCurrent($char);
        ;
 */
    }

    /**
     * {@inheritDoc}
     */
    protected function tearDown()
    {
        parent::tearDown();
        $this->em->close();
    }
}
?>